package com.yan.common.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * Created by yanl_ on 2018/4/17.
 */
public class MsgSendReturnCallback implements RabbitTemplate.ReturnCallback {

    private static Logger logger = LoggerFactory.getLogger(MsgSendConfirmCallBack.class);

    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        String msgJson = new String(message.getBody());
        logger.info("message return:{}", msgJson);
    }
}
